Resource URL: /platform/<<version=4>>/performance/workload-categories/<WORKLOAD-CATEGORY>/workloads

    Overview: This resource represents the collection of "workloads" selected
              for the workload category specified in the URI. A workload is a
              selection of specific values for each element in its category.
              These values are "pinned" and statistics for them will always be
              collected and available for viewing at
              /statistics/current?key=node.accounting.workloads.category.<category-id>,
              even if they are not among the top resource-consuming
              combinations of their category's elements.  For example, a
              category with the elements "zone_name" and "protocol" might have
              a workload with the selection "zone_name:System",
              "protocol:nfs4".  Now performance statistics about nfs v4 usage
              in the System zone are "pinned" and will always be collected and
              available, in addition to statistics about the top
              resource-consuming zone_name/protocol combinations.

     Methods: GET, POST, DELETE

********************************************************************************

Method GET: List all workloads.

       URL: GET
            /platform/<<version=4>>/performance/workload-categories/<WORKLOAD-CATEGORY>/workloads

Query arguments:
  sort=<string> The field that will be used for sorting.
limit=<integer> Return no more than this many results at once (see resume).
     dir=<enum> Where <enum> is one of ASC, DESC.  The direction of the sort.
resume=<string> Continue returning results from previous call using this token
                (token should come from the previous call, resume cannot be
                used with other options).

GET response body schema:
{
  "type": [
    {
      "additionalProperties": false, 
      "type": "object", 
      "description": "A list of errors that may be returned.", 
      "properties": {
        "errors": {
          "items": {
            "additionalProperties": false, 
            "type": "object", 
            "description": "An object describing a single error.", 
            "properties": {
              "field": {
                "type": "string", 
                "description": "The field with the error if applicable."
              }, 
              "message": {
                "type": "string", 
                "description": "The error message."
              }, 
              "code": {
                "type": "string", 
                "description": "The error code."
              }
            }
          }, 
          "type": "array"
        }
      }
    }, 
    {
      "additionalProperties": false, 
      "type": "object", 
      "properties": {
        "total": {
          "minimum": 0, 
          "type": "integer", 
          "description": "Total number of items available.", 
          "maximum": 4294967295
        }, 
        "workloads": {
          "minItems": 0, 
          "items": {
            "type": "object", 
            "description": "Once an workload category is configured, then a workload can be observed.", 
            "properties": {
              "workload_selector": {
                "type": "object", 
                "description": "Unique workload.", 
                "properties": {
                  "username": {
                    "type": "string", 
                    "description": "username"
                  }, 
                  "local_address": {
                    "type": "string", 
                    "description": "Local IPv4, IPv6 address"
                  }, 
                  "protocol": {
                    "enum": [
                      "nfs3", 
                      "nfs4", 
                      "nlm", 
                      "smb1", 
                      "smb2"
                    ], 
                    "type": "string", 
                    "description": "The protocol used for the request"
                  }, 
                  "remote_address": {
                    "type": "string", 
                    "description": "Client IPv4, IPv6 address, or hostname."
                  }, 
                  "zone_name": {
                    "type": "string", 
                    "description": "The zone name"
                  }
                }
              }, 
              "name": {
                "type": "string", 
                "description": "The name of the workload. User specified.", 
                "maxLength": 80
              }, 
              "creation_time": {
                "type": "integer", 
                "description": "Timestamp of when the workload was pinned."
              }, 
              "error": {
                "type": "string", 
                "description": "If this field is present, then there was an error fetching the workload configuration."
              }, 
              "workload_category_id": {
                "type": "integer", 
                "description": "Identifies the associated configured workload category."
              }, 
              "id": {
                "type": "integer", 
                "description": "The workload ID. Unique and automatically assigned."
              }
            }
          }, 
          "type": "array", 
          "maxItems": 4294967295
        }, 
        "resume": {
          "minLength": 0, 
          "type": [
            "string", 
            "null"
          ], 
          "description": "Continue returning results from previous call using this token (token should come from the previous call, resume cannot be used with other options)."
        }
      }
    }
  ]
}

********************************************************************************

Method POST: Create a new workload.

        URL: POST
             /platform/<<version=4>>/performance/workload-categories/<WORKLOAD-CATEGORY>/workloads

There are no query arguments for this method.

Required POST request body fields:
workload_selector

POST request body schema:
{
  "type": "object", 
  "description": "Once an workload category is configured, then a workload can be observed.", 
  "properties": {
    "workload_selector": {
      "required": true, 
      "type": "object", 
      "description": "Unique workload.", 
      "properties": {
        "username": {
          "type": "string", 
          "description": "username"
        }, 
        "local_address": {
          "type": "string", 
          "description": "Local IPv4, IPv6 address"
        }, 
        "protocol": {
          "enum": [
            "nfs3", 
            "nfs4", 
            "nlm", 
            "smb1", 
            "smb2"
          ], 
          "type": "string", 
          "description": "The protocol used for the request"
        }, 
        "remote_address": {
          "type": "string", 
          "description": "Client IPv4, IPv6 address, or hostname."
        }, 
        "zone_name": {
          "type": "string", 
          "description": "The zone name"
        }
      }
    }, 
    "name": {
      "type": "string", 
      "description": "The name of the workload. User specified.", 
      "maxLength": 80
    }
  }
}

POST response body schema:
{
  "type": [
    {
      "additionalProperties": false, 
      "type": "object", 
      "description": "A list of errors that may be returned.", 
      "properties": {
        "errors": {
          "items": {
            "additionalProperties": false, 
            "type": "object", 
            "description": "An object describing a single error.", 
            "properties": {
              "field": {
                "type": "string", 
                "description": "The field with the error if applicable."
              }, 
              "message": {
                "type": "string", 
                "description": "The error message."
              }, 
              "code": {
                "type": "string", 
                "description": "The error code."
              }
            }
          }, 
          "type": "array"
        }
      }
    }, 
    {
      "type": "object", 
      "properties": {
        "id": {
          "required": true, 
          "minimum": 0, 
          "type": "integer", 
          "description": "ID of created item that can be used to refer to item in the collection-item resource path.", 
          "maximum": 18446744073709551615
        }
      }
    }
  ]
}

********************************************************************************

Method DELETE: Delete all workloads associated with the workload category.

          URL: DELETE
               /platform/<<version=4>>/performance/workload-categories/<WORKLOAD-CATEGORY>/workloads

There are no query arguments for this method.

There is no JSON response body for this method.
